home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / gnu / gpp-1_42.lha / g++-1.42.0 / dummy.c < prev    next >
C/C++ Source or Header  |  1991-10-19  |  2KB  |  80 lines

  1. /* We need this file, because there is no static version of libdl */
  2. /* Copyright (C) 1991 Free Software Foundation, Inc.
  3.  
  4. This file is part of GNU CC.
  5.  
  6. GNU CC is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2, or (at your option)
  9. any later version.
  10.  
  11. GNU CC is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. GNU General Public License for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with GNU CC; see the file COPYING.  If not, write to
  18. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  19.  
  20. /* As a special exception, if you link this file with files
  21.    compiled with GCC to produce an executable, this does not cause
  22.    the resulting executable to be covered by the GNU General Public License.
  23.    This exception does not however invalidate any other reasons why
  24.    the executable file might be covered by the GNU General Public License.  */
  25.  
  26. #include "init_main.h"
  27.  
  28. /* dummy functions, which can be overwritten by the user */
  29. /* They are called before and after __init_main();
  30.     i.e. the static initialization */
  31.  
  32. #ifdef L_init_start
  33. void INIT_START() {}
  34. #endif 
  35.  
  36. #ifdef L_init_end
  37. void INIT_END() {}
  38. #endif
  39.  
  40.  
  41. /* in case that there are no global constructors we need these dummies */
  42.  
  43. #ifdef L_ctor_list
  44. ep_fp * __CTOR_LIST__ = 0;
  45. #endif
  46.  
  47. #ifdef L_dtor_list
  48. ep_fp * __DTOR_LIST__ = 0;
  49. #endif
  50.  
  51. /* dymmy functions needed when using static and dynamic linking */
  52.  
  53. #ifdef l_dl 
  54. #if defined( sun) && !defined( NO_DYNAMIC_LIBS)
  55.  
  56. #include <dlfcn.h>
  57.  
  58. void __eprintf ();        /* Defined in gnulib */
  59.  
  60. void *dlopen( char * path, int mode)
  61. {
  62.     __eprintf( "ERROR: dlopen must never be called.\n");
  63.     abort();
  64. }
  65.  
  66. char *dlerror()
  67. {
  68.     __eprintf( "ERROR: dlerror must never be called.\n");
  69.     abort();
  70. }
  71.  
  72. void *dlsym( void * handle, char * symbol)
  73. {
  74.     __eprintf( "ERROR: dlsym must never be called.\n");
  75.     abort();
  76. }
  77.  
  78. #endif
  79. #endif /* L_dl */
  80.